package vue;

import java.awt.BorderLayout;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;

import javax.swing.JFrame;

public class MainFrame extends JFrame {
	// Variable(s) statique(s)
	private static final long serialVersionUID = 1L;
	
	// Variable(s) d'instance
	private PanelBackground background;
	
	// Constructeur(s)
	public MainFrame() {
		super();
		
		this.setTitle("Duck hunt");
		GraphicsEnvironment.getLocalGraphicsEnvironment();
		this.setExtendedState(this.getExtendedState() | MainFrame.MAXIMIZED_BOTH);
		this.setUndecorated(true);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.background=new PanelBackground();
		this.add(this.background, BorderLayout.NORTH);
		
		setCursor(Toolkit.getDefaultToolkit().createCustomCursor(new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB), new Point(0, 0), "cursor"));
	    

		
		this.setVisible(true);
		
	}
	
	// Methode(s)
	public void addDuck(Duck canard) {
		this.background.addDuck(canard);
	}
	
	public PanelBackground getPanel() {
		return this.background;
	}
}
